﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Data;
using Lmm;
namespace DemoReception
{
    public class CCommonFunction
    {
        private static CLmmLogHelper iAppLog;

        public static void InitLogger(string aLogPath = "")
        {
            if (string.IsNullOrEmpty(aLogPath))
            {
                aLogPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "Log");
                if (!Directory.Exists(aLogPath)) Directory.CreateDirectory(aLogPath);
            }
            iAppLog = new CLmmLogHelper(aLogPath, "Application");
        }

        public static CLmmLogHelper GetLogger()
        {
            return iAppLog;
        }
    }



    public class CObjectToStringConverter : IValueConverter
    {
        public object Convert(object o, Type type, object parameter, CultureInfo culture)
        {
            return o.ToString();
        }

        public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
        {
            return null;
        }
    }


    public class EmSelectItem
    {
        public string iValue { get; set; }
        public string iText { get; set; }
        public object iTagValue { get; set; }
    }
}
